﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GBPVR.Public;
using System.IO;

namespace GBPVRLibrary.UtilityLibrary
{
    public class LogWriter
    {
        public delegate void WriteMethodDelegate(string Message);
        public static WriteMethodDelegate WriteMethod { get; set; }

        public static void Log(Exception Ex)
        {
            Log(Ex.Message + Environment.NewLine + Ex.StackTrace);
        }

        public static void Log(string Message)
        {
            try
            {
                if (WriteMethod != null)
                    WriteMethod(Message);
                else
                    Logger.Verbose(Message);
            }
            catch (Exception) { }
        }        
    }
}
